//


#import "MB_DietTableViewCell.h"

@implementation MB_DietTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        //
        UILabel * label1 = [[UILabel alloc]init];
        label1.textColor = rgba(30, 30, 30, 1);
        label1.font = FontPFMedium(kRWidth(17));
        label1.text = @"Diet records";
        [self.contentView addSubview:label1];
        [label1 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_offset(kRHeight(10));
            make.left.mas_offset(kRWidth(15));
            make.height.mas_equalTo(kRHeight(20));
        }];
        //
        self.dateLabel = ({
            UILabel *label = [[UILabel alloc]init];
            label.textColor = rgba(255, 140, 105, 1);
            label.font = FontPFMedium(kRWidth(15));
            label.text = @"";
            [self.contentView addSubview:label];
            label;
        });
        [self.dateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.mas_equalTo(label1);
            make.right.mas_offset(-kRWidth(15));
            make.height.mas_equalTo(kRHeight(20));
        }];
        
        self.labelB = ({
            UILabel *label = [[UILabel alloc]init];
            label.textColor = rgba(255, 140, 105, 1);
            label.font = FontPFRegular(kRWidth(15));
            label.text = @"breakfast->";
            [self.contentView addSubview:label];
            label;
        });
        [self.labelB mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(label1.mas_bottom).offset(kRHeight(10));
            make.left.mas_offset(kRWidth(15));
            make.height.mas_equalTo(kRHeight(20));
        }];
        
        self.labelC = ({
            UILabel *label = [[UILabel alloc]init];
            label.textColor = rgba(255, 140, 105, 1);
            label.font = FontPFRegular(kRWidth(15));
            label.text = @"chinese meal->";
            [self.contentView addSubview:label];
            label;
        });
        [self.labelC mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.labelB.mas_bottom).offset(kRHeight(10));
            make.left.mas_offset(kRWidth(15));
            make.height.mas_equalTo(kRHeight(20));
        }];
        
        self.labelD = ({
            UILabel *label = [[UILabel alloc]init];
            label.textColor = rgba(255, 140, 105, 1);
            label.font = FontPFRegular(kRWidth(15));
            label.text = @"dinner->";
            [self.contentView addSubview:label];
            label;
        });
        [self.labelD mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.labelC.mas_bottom).offset(kRHeight(10));
            make.left.mas_offset(kRWidth(15));
            make.height.mas_equalTo(kRHeight(20));
        }];
        self.labelO = ({
            UILabel *label = [[UILabel alloc]init];
            label.textColor = rgba(255, 140, 105, 1);
            label.font = FontPFRegular(kRHeight(15));
            label.text = @"other->";
            [self.contentView addSubview:label];
            label;
        });
        [self.labelO mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.labelD.mas_bottom).offset(kRHeight(10));
            make.left.mas_offset(kRWidth(15));
            make.height.mas_equalTo(kRHeight(20));
        }];
        
    }
    return self;
}
//
- (void)setModel:(DietData *)model {
    _model = model;
    //
    self.labelB.text = [NSString stringWithFormat:@"breakfast《%@》",model.breakfast];
    self.labelC.text = [NSString stringWithFormat:@"chinese meal《%@》",model.chineseMeal];
    self.labelD.text = [NSString stringWithFormat:@"dinner《%@》",model.dinner];
    self.labelO.text = [NSString stringWithFormat:@"other《%@》",model.other];
    self.dateLabel.text = model.date;
    
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
